﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using GestorSQL.DAO.FileManager;

namespace GestorSQL.BLL
{
    public class BLLTextReader : IDisposable
    {
        private StreamReader reader = null;

        public BLLTextReader(string path, string fileNameWithOutExtesion)
        {
            TextFile textFile = new TextFile();
            reader = textFile.GetStreamReader(path, fileNameWithOutExtesion);
        }

        public string ReadLine()
        {
            return reader.ReadLine();
        }

        public void Close()
        {
            if (reader != null)
                reader.Close();
        }

        #region IDisposable Members

        public void Dispose()
        {
            if (reader != null)
            {
                reader.Close();
                reader.Dispose();
            }
        }

        #endregion
    }
}
